import {ElMessageBox, ElNotification} from "element-plus";

export default {

    okNotify(msg, position = 'top-right') {
        ElNotification({
            message: msg,
            type: 'success',
            duration: 1500,
            position
        })
    },

    warningNotify(msg, position = 'top-right') {
        ElNotification({
            message: msg,
            type: 'warning',
            duration: 1500,
            position
        })
    },

    errorNotify(msg, position = 'top-right') {
        ElNotification({
            message: msg,
            type: 'error',
            duration: 1500,
            position
        })
    },

    notify(msg, position = 'top-right') {
        ElNotification({
            message: msg,
            type: 'info',
            duration: 1500,
            position
        })
    },

    confirm(content) {
        return ElMessageBox.confirm(content, '系统提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
        })
    }
}
